<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('PMS缺陷信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>缺陷所在单位：</label>
                                <input type="text" name="faultGroup"/>
                            </li>
                            <li>
                                <label>发现时间：</label>
                                <input type="text" class="time-input" placeholder="请选择发现时间" name="startTime"/>
                            </li>
                            <li>
                                <label>电站/线路：</label>
                                <input type="text" name="substationName"/>
                            </li>
                            <li>
                                <label>缺陷设备：</label>
                                <input type="text" name="deviceDescription"/>
                            </li>
                            <li>
                                <label>缺陷内容：</label>
                                <input type="text" name="faultDescription"/>
                            </li>
                            <li>
                                <label>缺陷类型：</label>
                                <input type="text" name="faultTy"/>
                            </li>
                            <li>
                                <label>设备类型：</label>
                                <input type="text" name="deviceTy"/>
                            </li>
                            <li>
                                <label>电压等级：</label>
                                <input type="text" name="voltageLevel"/>
                            </li>
                            <li>
                                <label>生产厂家：</label>
                                <input type="text" name="supplierName"/>
                            </li>
                            <li>
                                <label>缺陷性质：</label>
                                <input type="text" name="faultDegree"/>
                            </li>
                            <li>
                                <label>缺陷描述：</label>
                                <input type="text" name="faultDetails"/>
                            </li>
                            <li>
                                <label>是否消缺：</label>
                                <input type="text" name="isSolve"/>
                            </li>
                            <li>
                                <label>消缺时间：</label>
                                <input type="text" class="time-input" placeholder="请选择消缺时间" name="overTime"/>
                            </li>
                            <li>
                                <label>处理结果：</label>
                                <input type="text" name="faultRe"/>
                            </li>
                            <li>
                                <label>设备型号：</label>
                                <input type="text" name="deviceModel"/>
                            </li>
                            <li>
                                <label>投运时间：</label>
                                <input type="text" class="time-input" placeholder="请选择投运时间" name="beginRunTime"/>
                            </li>
                            <li>
                                <label>投运年：</label>
                                <input type="text" name="beginYear"/>
                            </li>
                            <li>
                                <label>护线员：</label>
                                <input type="text" name="lineMember"/>
                            </li>
                            <li>
                                <label>消缺班组：</label>
                                <input type="text" name="solveGroup"/>
                            </li>
                            <li>
                                <label>消缺人：</label>
                                <input type="text" name="solveMember"/>
                            </li>
                            <li>
                                <label>缺陷来源：</label>
                                <input type="text" name="faultSource"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:pms:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:pms:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:pms:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <!--        新增导出按钮        -->
                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:pms:import">
                    <i class="fa fa-upload"></i> 导入
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:pms:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:pms:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:pms:remove')}]];
        var prefix = ctx + "system/pms";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                <!--        新增导入链接        -->
                importUrl: prefix + "/importData",
                importTemplateUrl: prefix + "/importTemplate",
                modalName: "PMS缺陷信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'faultId',
                    title: '缺陷id',
                    visible: false
                },
                {
                    field: 'faultGroup',
                    title: '缺陷所在单位'
                },
                {
                    field: 'startTime',
                    title: '发现时间'
                },
                {
                    field: 'faultStatus',
                    title: '缺陷状态'
                },
                {
                    field: 'substationName',
                    title: '电站/线路'
                },
                {
                    field: 'deviceDescription',
                    title: '缺陷设备'
                },
                {
                    field: 'faultDescription',
                    title: '缺陷内容'
                },
                {
                    field: 'faultTy',
                    title: '缺陷类型'
                },
                {
                    field: 'deviceTy',
                    title: '设备类型'
                },
                {
                    field: 'voltageLevel',
                    title: '电压等级'
                },
                {
                    field: 'supplierName',
                    title: '生产厂家'
                },
                {
                    field: 'faultDegree',
                    title: '缺陷性质'
                },
                {
                    field: 'faultDetails',
                    title: '缺陷描述'
                },
                {
                    field: 'isSolve',
                    title: '是否消缺'
                },
                {
                    field: 'overTime',
                    title: '消缺时间'
                },
                {
                    field: 'faultRe',
                    title: '处理结果'
                },
                {
                    field: 'deviceModel',
                    title: '设备型号'
                },
                {
                    field: 'beginRunTime',
                    title: '投运时间'
                },
                {
                    field: 'beginYear',
                    title: '投运年'
                },
                {
                    field: 'lineMember',
                    title: '护线员'
                },
                {
                    field: 'solveGroup',
                    title: '消缺班组'
                },
                {
                    field: 'solveMember',
                    title: '消缺人'
                },
                {
                    field: 'faultSource',
                    title: '缺陷来源'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.faultId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.faultId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
<!-- 新增导入区域，并修改文字信息 -->
<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <input type="checkbox" id="updateSupport" name="updateSupport" title="如果地市级公司信息已经存在，更新这条数据。"> 是否更新已经存在的地市级公司信息
                &nbsp;	<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
            </div>
            <font color="red" class="pull-left mt10">
                提示：仅允许导入“xls”或“xlsx”格式文件！
            </font>
        </div>
    </form>
</script>
</html>